package gui.edit.listeners;

import gui.edit.components.dialogs.JDialogFillParam;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author Charles Perin
 * 29 mars 2011
 * LIMSI - INRIA Rennes
 * charles.perin@free.fr
 *
 */
public class ListenerFillParamOkButton implements ActionListener{

	private JDialogFillParam parent;

	public ListenerFillParamOkButton(JDialogFillParam parent){
		this.setParent(parent);
	}

	public void actionPerformed(ActionEvent arg0) {
		if(parent != null){
			parent.getParamControl().getParamsControl().fillParam(
					parent.getParamControl(),
					parent.getY1(),
					parent.getY2(),
					parent.getInterpolationUpValue(),
					parent.getInterpolationDownValue());

			//parent.getdataControl.updateVisuPane();
		}
		parent.getParent().setEnabled(true);
		parent.setVisible(false);
	}

	public void setParent(JDialogFillParam parent) {
		this.parent = parent;
	}

	public JDialogFillParam getParent() {
		return parent;
	}

}
